import cubeEnum from "../enum/cube.enum"
import { OutOfRangeException } from "../exception/range.exception"

const cubeData = {
  0: cubeEnum.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  1: cubeEnum.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  2: cubeEnum.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  3: cubeEnum.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  4: cubeEnum.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  5: cubeEnum.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
}
export const getCubeFace = (e: keyof typeof cubeData) => {
  if (e < 0 || e > 5) throw new OutOfRangeException("mapFaceToCubemapFace() -> face must be in the range [0, 5]")
  return cubeData[e]
}
